package com.itheima.tliasmanagement.mapper;

import com.github.pagehelper.Page;
import com.itheima.tliasmanagement.dto.StudentListDto;
import com.itheima.tliasmanagement.entity.Student;
import com.itheima.tliasmanagement.vo.NameValueVo;
import com.itheima.tliasmanagement.vo.StudentListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {
    @Select("select * from student where clazz_id = #{clazzId}")
    List<Student> selectByClazzId(Integer clazzId);

    Page<StudentListVo> pageQuery(StudentListDto dto);

    Student selectByNoOrPhoneOrIdCard(@Param("no") String no,
                                      @Param("phone")String phone,
                                      @Param("idCard")String idCard);

    void insert(Student student);

    StudentListVo selectById(Integer id);

    void update(Student student);

    void deleteByIds(List<Integer> ids);

    void updateViolation(@Param("id") Integer id, @Param("score")Integer score);

    List<NameValueVo> studentDegreeData();
}
